program Project1;

{$APPTYPE CONSOLE}

uses
  SysUtils;

type
pelement=^element;
element=record
  value:integer;
  next:pelement;
end;
var
head,current, tmp:pelement;
num,i,a:integer;
mass:array of integer;
begin
readln(a);
  for i:=0 to a-1 do
    readln(mass[i]);
  For i:=0 to a-1 do
    begin
      tmp:=head;
      new(head);
      head^.value:=mass[i];
      Head^.next:=tmp;
  end;
  tmp:=head^.next^.next^.next^.next;
  head^.next^.next^.next:=head^.next^.next^.next^.next;

  dispose(tmp);
  current:=head;
  while(current<>nil) do
    begin
      writeln(current^.value);
      current:=current^.next;
    end;
  Readln;


end.
